Shader "Custom/UVHighlight"
{
    Properties
    {
        _Color("Color", Color) = (1, 0, 0, 1)
        _Highlight("Highlight(x, y, 0, 0)", Vector) = (0, 0, 0.3, 0)
    }
        SubShader
        {
            Pass
            {
                CGPROGRAM
                #pragma vertex vert
                #pragma fragment frag

                struct a2v
                {
                    float4 pos: POSITION;
                    float2 uv: TEXCOORD0;
                    float4 color : COLOR;
                };

                struct v2f
                {
                    float4 pos : SV_POSITION;
                    float2 uv: TEXCOORD0;
                    float4 color : COLOR;
                };

                uniform float4 _Color;
                uniform float4 _Highlight;

                v2f vert(a2v i)
                {
                    v2f o;
                    o.pos = UnityObjectToClipPos(i.pos);
                    o.uv = i.uv;
                    o.color = i.color;
                    return o;
                }

                fixed4 frag(v2f i) : COLOR
                {
                    float2 pos = _Highlight.xy;
                    float radius = _Highlight.z;
                    float t = distance(i.uv, pos) / radius;

                    return lerp(_Color, i.color, t);
                }

                ENDCG
            }
        }
        FallBack "UI/Default"
}